/* Copyright (c) 2006 by M Aamir Maniar 
 * 
 * Permission is hereby granted, free of charge, to any person obtaining 
 * a copy of this software and associated documentation files (the 
 * "Software"), to deal in the Software without restriction, including 
 * without limitation the rights to use, copy, modify, merge, publish, 
 * distribute, sublicense, and/or sell copies of the Software, and to 
 * permit persons to whom the Software is furnished to do so, subject to 
 * the following conditions:
 * 
 * The above copyright notice and this permission notice shall be 
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 * 
 * */

namespace Generic.DataStructures
{
	using System;
	using System.Collections.Generic;
	using System.Text;

	/// <summary>
	/// Represents the stack;
	/// </summary>
	/// <remarks>
	/// Use the stack when you want list based on FIFO (first-in last-out) principal.
	/// </remarks>
	/// <typeparam name="T"></typeparam>
	public interface IStack<T> : ICollection<T>, ICloneable
	{
		#region void Push(T item)
		/// <summary>
		/// Pushes the specified item at the top of <see cref="Stack&lt;T&gt;"/>.
		/// </summary>
		/// <param name="item">The item to be pushed.</param>
		void Push(T item);
		#endregion 

		#region T Pop()
		/// <summary>
		/// Pops the top most item from the <see cref="Stack&lt;T&gt;"/>.
		/// </summary>
		/// <returns>The item poped.</returns>
		T Pop();
		#endregion

		#region T Top
		/// <summary>
		/// Gets the top most element withought changing <see cref="Stack&lt;T&gt;"/>.
		/// </summary>
		/// <returns></returns>
		T Top {get; }
		#endregion

		#region bool FixedSize
		/// <summary>
		/// Gets or sets a value indicating whether <see cref="Stack&lt;T&gt;"/> is fixed sized.
		/// </summary>
		/// <value><c>true</c> if <see cref="Stack&lt;T&gt;"/> is fixed sized; otherwise, <c>false</c>.</value>
		/// <remarks>
		/// By default <see cref="Stack&lt;T&gt;"/> is fixed sized.
		/// </remarks>
		bool FixedSize { get; set; }
		#endregion

		#region bool IsFull
		/// <summary>
		/// Gets a value indicating whether <see cref="Stack&lt;T&gt;"/> is full.
		/// </summary>
		/// <value><c>true</c> if this instance is full; otherwise, <c>false</c>.</value>
		bool IsFull { get;}
		#endregion

		#region bool IsEmpty
		/// <summary>
		/// Gets a value indicating whether this instance is empty.
		/// </summary>
		/// <value><c>true</c> if this instance is empty; otherwise, <c>false</c>.</value>
		bool IsEmpty { get;}
		#endregion

		#region bool IsSynchronized
		/// <summary>
		/// Gets a value indicating whether this instance is synchronized.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if this instance is synchronized; otherwise, <c>false</c>.
		/// </value>
		bool IsSynchronized { get; }
		#endregion

		#region int Capacity
		/// <summary>
		/// Gets or sets the capacity of the <see cref="Stack&lt;T&gt;"/>.
		/// </summary>
		/// <value>The capacity.</value>
		int Capacity { get;set;}

		#endregion

		#region GCollectionGrowingMode GrowMode
		/// <summary>
		/// Gets or sets the grow mode of the <see cref="Stack&lt;T&gt;"/>.
		/// </summary>
		/// <value>The grow mode.</value>
		StackGrowingMode GrowMode { get;set;}
		#endregion

		#region object SyncRoot
		/// <summary>
		/// Gets the SyncRoot, an object that help to created synchronized objects.
		/// </summary>
		/// <value>The sync root.</value>
		object SyncRoot { get;}
		#endregion

	}
}
